<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>test.sieve</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Sieve) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
<span style="color:#7a7c7d;"># Sieve syntax highlighting test</span>
<span style="color:#7a7c7d;"># see RFC 5228</span>

<span style="color:#7a7c7d;"># comments §2.3.</span>

<span style="color:#7a7c7d;"># Single line with alerts </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold;">TODO</span><span style="color:#7a7c7d;"> </span><span style="color:#81ca2d;background-color:#4d1f24;font-weight:bold;">###</span>
<span style="color:#7a7c7d;">/*</span>
<span style="color:#7a7c7d;"> Multiline comment with alerts </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold;">FIXME</span>
<span style="color:#7a7c7d;"> this also should be folding region</span>
<span style="color:#7a7c7d;"> */</span>

<span style="color:#7a7c7d;"># literal data §2.4.</span>
<span style="color:#7a7c7d;"># numbers §2.4.1.</span>
<span style="color:#f67400;">42</span>
<span style="color:#f67400;">100K</span>
<span style="color:#f67400;">10M</span>
<span style="color:#f67400;">3G</span>

<span style="color:#7a7c7d;"># strings §2.4.2.</span>
<span style="color:#f44f4f;">&quot;string&quot;</span>
<span style="color:#f44f4f;">&quot;string</span><span style="color:#3daee9;">\n</span><span style="color:#f44f4f;">with</span><span style="color:#3daee9;">\&quot;</span><span style="color:#f44f4f;">special chars&quot;</span>
<span style="color:#7a7c7d;"># not a string</span>
<span style="color:#f44f4f;">&quot;multi \</span>
<span style="color:#f44f4f;"> line \</span>
<span style="color:#f44f4f;"> #with</span><span style="color:#3daee9;">\a</span><span style="color:#f44f4f;"> \</span>
<span style="color:#f44f4f;"> continuation&quot;</span>
<span style="color:#7a7c7d;"># not a string</span>
<span style="color:#f44f4f;">text:</span>
<span style="color:#f44f4f;">Multiline</span>
<span style="color:#f44f4f;">string</span><span style="color:#3daee9;">\&quot;</span><span style="color:#f44f4f;"> &quot;with quotes&quot;</span>
<span style="color:#f44f4f;">or # comments</span>
<span style="color:#f44f4f;">this should also be a folding region</span>
<span style="color:#f44f4f;">.dot</span>
<span style="color:#f44f4f;">..dot</span>
<span style="color:#f44f4f;">dotstuffed dot:</span>
<span style="color:#f44f4f;">..</span>
<span style="color:#f44f4f;">ending with a single .</span>
<span style="color:#f44f4f;">.</span>

<span style="color:#7a7c7d;"># encoded characters §2.4.2.4.</span>
<span style="color:#7a7c7d;"># valid</span>
<span style="color:#f44f4f;">&quot;$</span><span style="color:#3daee9;">${hex:24 24}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${unicode:40}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;$</span><span style="color:#3daee9;">${hex:40}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${hex: da }</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${hex:FE }</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${HEX: 40}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${unicode:40}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${UNICODE:40}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${UnICoDE:0000040}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${Unicode:ff}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#7a7c7d;">#invalid</span>
<span style="color:#f44f4f;">&quot;${hex:40&quot;</span>
<span style="color:#f44f4f;">&quot;${hex:4</span><span style="color:#3daee9;">${hex:30}</span><span style="color:#f44f4f;">}&quot;</span>
<span style="color:#f44f4f;">&quot;${ unicode:40}&quot;</span>
<span style="color:#f44f4f;">&quot;${Unicode:Cool}&quot;</span>
<span style="color:#7a7c7d;"># semantic errors, syntactically correct</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${hex:400}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${unicode:200000}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">${Unicode:DF01}</span><span style="color:#f44f4f;">&quot;</span>

<span style="color:#7a7c7d;"># test lists §2.5.1</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">anyof</span> (<span style="color:#7f8c8d;">not</span> <span style="color:#7f8c8d;">exists</span> [<span style="color:#f44f4f;">&quot;From&quot;</span>, <span style="color:#f44f4f;">&quot;Date&quot;</span>],
          <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;fool@example.com&quot;</span>) {
    <span style="color:#8e44ad;">discard</span>;
}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">allof</span> (<span style="color:#7f8c8d;">not</span> <span style="color:#7f8c8d;">exists</span> [<span style="color:#f44f4f;">&quot;From&quot;</span>, <span style="color:#f44f4f;">&quot;Date&quot;</span>],
          <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;fool@example.com&quot;</span>) {
    <span style="color:#8e44ad;">discard</span>;
}

<span style="color:#7a7c7d;"># match types §2.7.1.</span>
<span style="color:#0099ff;font-weight:bold;">:contains</span>
<span style="color:#0099ff;font-weight:bold;">:matches</span>
<span style="color:#0099ff;font-weight:bold;">:is</span>

<span style="color:#7a7c7d;"># comparators §2.7.3.</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;octet&quot;</span> <span style="color:#f44f4f;">&quot;Subject&quot;</span> <span style="color:#f44f4f;">&quot;MAKE MONEY FAST&quot;</span> {
    <span style="color:#8e44ad;">discard</span>;
}

<span style="color:#7a7c7d;"># comparison against addresses §2.7.4.</span>
<span style="color:#27ae60;">:localpart</span>
<span style="color:#27ae60;">:domain</span>
<span style="color:#27ae60;">:all</span>

<span style="color:#7a7c7d;"># commands §2.9.</span>
<span style="color:#8e44ad;">keep</span>;
<span style="color:#8e44ad;">fileinto</span> <span style="color:#f44f4f;">&quot;inbox.bla&quot;</span>;
<span style="color:#8e44ad;">redirect</span> <span style="color:#f44f4f;">&quot;test@kde.org&quot;</span>;
<span style="color:#8e44ad;">discard</span>;

<span style="color:#7a7c7d;"># control if §3.1.</span>
<span style="color:#7a7c7d;"># this also should create folding regions</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;foo&quot;</span> {
    <span style="color:#8e44ad;">discard</span>;
} <span style="font-weight:bold;">elsif</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> [<span style="color:#f44f4f;">&quot;subject&quot;</span>] [<span style="color:#f44f4f;">&quot;$$$&quot;</span>] {
    <span style="color:#8e44ad;">discard</span>;
} <span style="font-weight:bold;">else</span> {
    <span style="color:#8e44ad;">fileinto</span> <span style="color:#f44f4f;">&quot;INBOX&quot;</span>;
}

<span style="color:#7a7c7d;"># control require §3.2.</span>
<span style="font-weight:bold;">require</span> <span style="color:#f44f4f;">&quot;fileinto&quot;</span>;
<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;vacation&quot;</span>, <span style="color:#f44f4f;">&quot;imapflags&quot;</span>];

<span style="color:#7a7c7d;"># control stop §3.3.</span>
<span style="color:#8e44ad;">stop</span>;

<span style="color:#7a7c7d;"># test commands §5.</span>
<span style="color:#7f8c8d;">address</span>
<span style="color:#7f8c8d;">allof</span>
<span style="color:#7f8c8d;">anyof</span>
<span style="color:#7f8c8d;">exists</span>
<span style="color:#7f8c8d;">false</span>
<span style="color:#7f8c8d;">header</span>
<span style="color:#7f8c8d;">not</span>
<span style="color:#7f8c8d;">size</span>
<span style="color:#7f8c8d;">true</span>

<span style="color:#7a7c7d;"># test address §5.1.</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">address</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#27ae60;">:all</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;kde@example.com&quot;</span> {
    <span style="color:#8e44ad;">discard</span>;
} <span style="font-weight:bold;">elsif</span> <span style="color:#7f8c8d;">address</span> <span style="color:#27ae60;">:domain</span> <span style="color:#0099ff;font-weight:bold;">:is</span> [<span style="color:#f44f4f;">&quot;From&quot;</span>, <span style="color:#f44f4f;">&quot;To&quot;</span>] <span style="color:#f44f4f;">&quot;example.com&quot;</span> { <span style="color:#7a7c7d;"># comment</span>
    <span style="color:#8e44ad;">keep</span>; <span style="color:#7a7c7d;"># comment</span>
}

<span style="color:#7a7c7d;"># test envelope §5.4.</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">envelope</span> <span style="color:#27ae60;">:all</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;kde@example.com&quot;</span> {
    <span style="color:#8e44ad;">discard</span>;
}

<span style="color:#7a7c7d;"># test exists §5.5.</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">not</span> <span style="color:#7f8c8d;">exists</span> [<span style="color:#f44f4f;">&quot;From&quot;</span>,<span style="color:#f44f4f;">&quot;Date&quot;</span>] {
    <span style="color:#8e44ad;">discard</span>;
}

<span style="color:#7a7c7d;"># test header §5.7.</span>
<span style="color:#7f8c8d;">not</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;Cc&quot;</span> <span style="color:#f44f4f;">&quot;?*&quot;</span>

<span style="color:#7a7c7d;"># test size §5.9.</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">size</span> <span style="color:#27ae60;">:over</span> <span style="color:#f67400;">500K</span> { <span style="color:#8e44ad;">discard</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">size</span> <span style="color:#27ae60;">:under</span> <span style="color:#f67400;">1M</span> { <span style="color:#8e44ad;">keep</span>; } <span style="font-weight:bold;">else</span> { <span style="color:#8e44ad;">discard</span>; }


<span style="color:#7a7c7d;">/*</span>
<span style="color:#7a7c7d;"> * Extensions</span>
<span style="color:#7a7c7d;"> * see https://www.iana.org/assignments/sieve-extensions/sieve-extensions.xhtml</span>
<span style="color:#7a7c7d;"> */</span>

<span style="color:#7a7c7d;"># Body RFC5173</span>
<span style="color:#27ae60;">:raw</span>
<span style="color:#27ae60;">:content</span>
<span style="color:#27ae60;">:text</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">body</span> <span style="color:#27ae60;">:raw</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;MAKE MONEY FAST&quot;</span> {
    <span style="color:#8e44ad;">discard</span>;
}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">body</span> <span style="color:#27ae60;">:content</span> <span style="color:#f44f4f;">&quot;text&quot;</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> [<span style="color:#f44f4f;">&quot;bla&quot;</span>, <span style="color:#f44f4f;">&quot;blub&quot;</span>] {
    <span style="color:#8e44ad;">fileinto</span> <span style="color:#f44f4f;">&quot;inbox.foo&quot;</span>;
}

<span style="color:#7a7c7d;"># Convert RFC6558</span>
<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;convert&quot;</span>];
<span style="color:#8e44ad;">convert</span> <span style="color:#f44f4f;">&quot;image/tiff&quot;</span> <span style="color:#f44f4f;">&quot;image/jpeg&quot;</span> [<span style="color:#f44f4f;">&quot;pix-x=320&quot;</span>,<span style="color:#f44f4f;">&quot;pix-y=240&quot;</span>];

<span style="color:#7a7c7d;"># Copy RFC3894</span>
<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;copy&quot;</span>, <span style="color:#f44f4f;">&quot;fileinto&quot;</span>];
<span style="color:#8e44ad;">fileinto</span> <span style="color:#27ae60;">:copy</span> <span style="color:#f44f4f;">&quot;incoming&quot;</span>;

<span style="color:#7a7c7d;"># Date RFC5260</span>
<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;date&quot;</span>, <span style="color:#f44f4f;">&quot;relational&quot;</span>, <span style="color:#f44f4f;">&quot;fileinto&quot;</span>];
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">allof</span>(<span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;boss@example.com&quot;</span>,
         <span style="color:#7f8c8d;">date</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;ge&quot;</span> <span style="color:#27ae60;">:originalzone</span> <span style="color:#f44f4f;">&quot;date&quot;</span> <span style="color:#f44f4f;">&quot;hour&quot;</span> <span style="color:#f44f4f;">&quot;09&quot;</span>,
         <span style="color:#7f8c8d;">date</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;lt&quot;</span> <span style="color:#27ae60;">:originalzone</span> <span style="color:#f44f4f;">&quot;date&quot;</span> <span style="color:#f44f4f;">&quot;hour&quot;</span> <span style="color:#f44f4f;">&quot;17&quot;</span>)
    { <span style="color:#8e44ad;">fileinto</span> <span style="color:#f44f4f;">&quot;urgent&quot;</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">anyof</span>(<span style="color:#7f8c8d;">date</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;received&quot;</span> <span style="color:#f44f4f;">&quot;weekday&quot;</span> <span style="color:#f44f4f;">&quot;0&quot;</span>,
         <span style="color:#7f8c8d;">date</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;received&quot;</span> <span style="color:#f44f4f;">&quot;weekday&quot;</span> <span style="color:#f44f4f;">&quot;6&quot;</span>)
{ <span style="color:#8e44ad;">fileinto</span> <span style="color:#f44f4f;">&quot;weekend&quot;</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">anyof</span>(<span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;weekday&quot;</span> <span style="color:#f44f4f;">&quot;0&quot;</span>,
         <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;weekday&quot;</span> <span style="color:#f44f4f;">&quot;6&quot;</span>,
         <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;lt&quot;</span> <span style="color:#f44f4f;">&quot;hour&quot;</span> <span style="color:#f44f4f;">&quot;09&quot;</span>,
         <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;ge&quot;</span> <span style="color:#f44f4f;">&quot;hour&quot;</span> <span style="color:#f44f4f;">&quot;17&quot;</span>)
{ <span style="color:#8e44ad;">redirect</span> <span style="color:#f44f4f;">&quot;pager@example.com&quot;</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">allof</span>(<span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;ge&quot;</span> <span style="color:#f44f4f;">&quot;date&quot;</span> <span style="color:#f44f4f;">&quot;2007-06-30&quot;</span>,
         <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;le&quot;</span> <span style="color:#f44f4f;">&quot;date&quot;</span> <span style="color:#f44f4f;">&quot;2007-07-07&quot;</span>)
{ <span style="color:#8e44ad;">vacation</span> <span style="color:#27ae60;">:days</span> <span style="color:#f67400;">7</span>  <span style="color:#f44f4f;">&quot;I'm away during the first week in July.&quot;</span>; }

<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;date&quot;</span>, <span style="color:#f44f4f;">&quot;variables&quot;</span>, <span style="color:#f44f4f;">&quot;fileinto&quot;</span>];
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;month&quot;</span> <span style="color:#f44f4f;">&quot;*&quot;</span> { <span style="color:#8e44ad;">set</span> <span style="color:#f44f4f;">&quot;month&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${1}</span><span style="color:#f44f4f;">&quot;</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;year&quot;</span>  <span style="color:#f44f4f;">&quot;*&quot;</span> { <span style="color:#8e44ad;">set</span> <span style="color:#f44f4f;">&quot;year&quot;</span>  <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${1}</span><span style="color:#f44f4f;">&quot;</span>; }
<span style="color:#8e44ad;">fileinto</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${month}</span><span style="color:#f44f4f;">-</span><span style="color:#27aeae;">${year}</span><span style="color:#f44f4f;">&quot;</span>;

<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;variables&quot;</span>, <span style="color:#f44f4f;">&quot;date&quot;</span>, <span style="color:#f44f4f;">&quot;editheader&quot;</span>];
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">currentdate</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;std11&quot;</span> <span style="color:#f44f4f;">&quot;*&quot;</span> {<span style="color:#8e44ad;">addheader</span> <span style="color:#f44f4f;">&quot;Processing-date&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${0}</span><span style="color:#f44f4f;">&quot;</span>;}

<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;date&quot;</span>, <span style="color:#f44f4f;">&quot;relational&quot;</span>, <span style="color:#f44f4f;">&quot;index&quot;</span>];
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">date</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;gt&quot;</span> <span style="color:#27ae60;">:index</span> <span style="color:#f67400;">2</span> <span style="color:#27ae60;">:zone</span> <span style="color:#f44f4f;">&quot;-0500&quot;</span> <span style="color:#f44f4f;">&quot;received&quot;</span> <span style="color:#f44f4f;">&quot;iso8601&quot;</span> <span style="color:#f44f4f;">&quot;2007-02-26T09:00:00-05:00&quot;</span>
{ <span style="color:#8e44ad;">redirect</span> <span style="color:#f44f4f;">&quot;aftercutoff@example.org&quot;</span>; }

<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#27ae60;">:index</span> <span style="color:#f67400;">1</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;received&quot;</span> <span style="color:#f44f4f;">&quot;*(* [*.*.*.*])*&quot;</span> {}

<span style="color:#7a7c7d;"># Duplicate RFC7352</span>
<span style="font-weight:bold;">require</span> [<span style="color:#f44f4f;">&quot;duplicate&quot;</span>, <span style="color:#f44f4f;">&quot;variables&quot;</span>];
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">duplicate</span> { <span style="color:#8e44ad;">discard</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">duplicate</span> <span style="color:#27ae60;">:header</span> <span style="color:#f44f4f;">&quot;message-id&quot;</span> { <span style="color:#8e44ad;">discard</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;message-id&quot;</span> <span style="color:#f44f4f;">&quot;*&quot;</span> {
    <span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">duplicate</span> <span style="color:#27ae60;">:uniqueid</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${0}</span><span style="color:#f44f4f;">&quot;</span> { <span style="color:#8e44ad;">discard</span>; }
}

<span style="color:#7a7c7d;"># Editheader RFC5293</span>
<span style="color:#8e44ad;">addheader</span> <span style="color:#f44f4f;">&quot;X-Hello&quot;</span> <span style="color:#f44f4f;">&quot;World&quot;</span>;
<span style="color:#8e44ad;">deleteheader</span> <span style="color:#27ae60;">:index</span> <span style="color:#f67400;">1</span> <span style="color:#f44f4f;">&quot;X-Hello&quot;</span>;

<span style="color:#7a7c7d;"># Enclose RFC5703</span>
<span style="color:#27ae60;">:mime</span>
<span style="color:#27ae60;">:anychild</span>
<span style="color:#27ae60;">:type</span>
<span style="color:#27ae60;">:subtype</span>
<span style="color:#27ae60;">:contenttype</span>
<span style="color:#27ae60;">:param</span>
<span style="color:#8e44ad;">replace</span>
<span style="color:#8e44ad;">enclose</span>
<span style="color:#8e44ad;">extracttext</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#27ae60;">:mime</span> <span style="color:#27ae60;">:type</span> <span style="color:#f44f4f;">&quot;Content-Type&quot;</span> <span style="color:#f44f4f;">&quot;image&quot;</span> {}
<span style="color:#8e44ad;">replace</span> <span style="color:#f44f4f;">&quot;Executable attachment removed by user filter&quot;</span>;
<span style="font-weight:bold;">foreverypart</span> {
    <span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#27ae60;">:mime</span> <span style="color:#27ae60;">:param</span> <span style="color:#f44f4f;">&quot;filename&quot;</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> [<span style="color:#f44f4f;">&quot;Content-Type&quot;</span>, <span style="color:#f44f4f;">&quot;Content-Disposition&quot;</span>]
        [<span style="color:#f44f4f;">&quot;*.com&quot;</span>, <span style="color:#f44f4f;">&quot;*.exe&quot;</span>, <span style="color:#f44f4f;">&quot;*.vbs&quot;</span>, <span style="color:#f44f4f;">&quot;*.scr&quot;</span>, <span style="color:#f44f4f;">&quot;*.pif&quot;</span>, <span style="color:#f44f4f;">&quot;*.hta&quot;</span>, <span style="color:#f44f4f;">&quot;*.bat&quot;</span>, <span style="color:#f44f4f;">&quot;*.zip&quot;</span> ] {
        <span style="color:#7a7c7d;"># these attachment types are executable</span>
        <span style="color:#8e44ad;">enclose</span> <span style="color:#27ae60;">:subject</span> <span style="color:#f44f4f;">&quot;Warning&quot;</span> <span style="color:#f44f4f;">text:</span>
<span style="color:#f44f4f;">WARNING! The enclosed message contains executable attachments.</span>
<span style="color:#f44f4f;">These attachment types may contain a computer virus program</span>
<span style="color:#f44f4f;">that can infect your computer and potentially damage your data.</span>
<span style="color:#f44f4f;">.</span>
;
        <span style="color:#8e44ad;">break</span>;
    }
}
<span style="color:#8e44ad;">extracttext</span> <span style="color:#27ae60;">:first</span> <span style="color:#f67400;">100</span> <span style="color:#f44f4f;">&quot;msgcontent&quot;</span>;

<span style="color:#7a7c7d;"># Notify RFC5435</span>
<span style="color:#8e44ad;">notify</span> <span style="color:#27ae60;">:importance</span> <span style="color:#f44f4f;">&quot;1&quot;</span> <span style="color:#27ae60;">:message</span> <span style="color:#f44f4f;">&quot;This is probably very important&quot;</span> <span style="color:#f44f4f;">&quot;mailto:kde@example.com&quot;</span>;
<span style="color:#8e44ad;">notify</span> <span style="color:#27ae60;">:message</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${from_addr}${env_from}</span><span style="color:#f44f4f;">: </span><span style="color:#27aeae;">${subject}</span><span style="color:#f44f4f;">&quot;</span> <span style="color:#f44f4f;">&quot;mailto:kde@example.com&quot;</span>;
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">not</span> <span style="color:#7f8c8d;">valid_notify_method</span> [<span style="color:#f44f4f;">&quot;mailto:&quot;</span>, <span style="color:#f44f4f;">&quot;http://gw.example.net/notify?test&quot;</span>] { <span style="color:#8e44ad;">stop</span>; }
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">notify_method_capability</span> <span style="color:#f44f4f;">&quot;xmpp:tim@example.com?message;subject=SIEVE&quot;</span> <span style="color:#f44f4f;">&quot;Online&quot;</span> <span style="color:#f44f4f;">&quot;yes&quot;</span> {}
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:encodeurl</span> <span style="color:#f44f4f;">&quot;body_param&quot;</span> <span style="color:#f44f4f;">&quot;stuff&quot;</span>;

<span style="color:#7a7c7d;"># Envelope DSN RFC6009</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">envelope</span> <span style="color:#f44f4f;">&quot;notify&quot;</span> <span style="color:#f44f4f;">&quot;SUCCESS&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">allof</span> (<span style="color:#7f8c8d;">envelope</span> <span style="color:#f44f4f;">&quot;notify&quot;</span> <span style="color:#f44f4f;">&quot;FAILURE&quot;</span>, <span style="color:#7f8c8d;">envelope</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#0099ff;font-weight:bold;">:count</span> <span style="color:#f44f4f;">&quot;eq&quot;</span> <span style="color:#f44f4f;">&quot;notify&quot;</span> <span style="color:#f44f4f;">&quot;1&quot;</span>) {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">envelope</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;orcpt&quot;</span> <span style="color:#f44f4f;">&quot;rfc822;*@example.com&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">anyof</span> (<span style="color:#7f8c8d;">envelope</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;bytimerelative&quot;</span> <span style="color:#f44f4f;">&quot;-&quot;</span>, <span style="color:#7f8c8d;">envelope</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;eq&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#f44f4f;">&quot;bytimerelative&quot;</span> <span style="color:#f44f4f;">&quot;0&quot;</span>) {}
<span style="color:#8e44ad;">redirect</span> <span style="color:#27ae60;">:copy</span> <span style="color:#27ae60;">:notify</span> <span style="color:#f44f4f;">&quot;NEVER&quot;</span> <span style="color:#f44f4f;">&quot;elsewhere@example.com&quot;</span>;
<span style="color:#8e44ad;">redirect</span> <span style="color:#27ae60;">:copy</span> <span style="color:#27ae60;">:bytimerelative</span> <span style="color:#f67400;">600</span> <span style="color:#f44f4f;">&quot;cellphone@example.com&quot;</span>;
<span style="color:#8e44ad;">redirect</span> <span style="color:#27ae60;">:copy</span> <span style="color:#27ae60;">:bytimeabsolute</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${date}</span><span style="color:#f44f4f;">T20:00:00</span><span style="color:#27aeae;">${zone}</span><span style="color:#f44f4f;">&quot;</span> <span style="color:#27ae60;">:bymode</span> <span style="color:#f44f4f;">&quot;return&quot;</span> <span style="color:#f44f4f;">&quot;cellphone@example.com&quot;</span>;

<span style="color:#7a7c7d;"># Environment RFC5183</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">environment</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;item&quot;</span> <span style="color:#f44f4f;">&quot;&quot;</span> {}

<span style="color:#7a7c7d;"># Reject RFC5429</span>
<span style="color:#8e44ad;">ereject</span> <span style="color:#f44f4f;">&quot;I no longer accept mail from this address&quot;</span>;
<span style="color:#8e44ad;">reject</span> <span style="color:#f44f4f;">text:</span>
<span style="color:#f44f4f;">Your message is too big.  If you want to send me a big attachment,</span>
<span style="color:#f44f4f;">put it on a public web site and send me a URL.</span>
<span style="color:#f44f4f;">.</span>
;

<span style="color:#7a7c7d;"># External Lists RFC6134</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">envelope</span> <span style="color:#27ae60;">:list</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;:addrbook:default&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">currentdate</span> <span style="color:#27ae60;">:list</span> <span style="color:#f44f4f;">&quot;date&quot;</span> <span style="color:#f44f4f;">&quot;tag:example.com,2011-01-01:localHolidays&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">allof</span> (<span style="color:#7f8c8d;">envelope</span> <span style="color:#27ae60;">:detail</span> <span style="color:#f44f4f;">&quot;to&quot;</span> <span style="color:#f44f4f;">&quot;mylist&quot;</span>, <span style="color:#7f8c8d;">header</span> <span style="color:#27ae60;">:list</span> <span style="color:#f44f4f;">&quot;from&quot;</span> <span style="color:#f44f4f;">&quot;tag:example.com,2010-05-28:mylist&quot;</span>) {
    <span style="color:#8e44ad;">redirect</span> <span style="color:#27ae60;">:list</span> <span style="color:#f44f4f;">&quot;tag:example.com,2010-05-28:mylist&quot;</span>;
}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">string</span> <span style="color:#27ae60;">:list</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${ip}</span><span style="color:#f44f4f;">&quot;</span> <span style="color:#f44f4f;">&quot;tag:example.com,2011-04-10:DisallowedIPs&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#27ae60;">:mime</span> <span style="color:#27ae60;">:param</span> <span style="color:#f44f4f;">&quot;filename&quot;</span> <span style="color:#27ae60;">:list</span> [<span style="color:#f44f4f;">&quot;Content-Type&quot;</span>, <span style="color:#f44f4f;">&quot;Content-Disposition&quot;</span>] <span style="color:#f44f4f;">&quot;tag:example.com,2011-04-10:BadFileNameExts&quot;</span> {}

<span style="color:#7a7c7d;"># ihave RFC5463</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">ihave</span> <span style="color:#f44f4f;">&quot;fileinto&quot;</span> {}
<span style="color:#8e44ad;">error</span> <span style="color:#f44f4f;">&quot;failed!&quot;</span>;

<span style="color:#7a7c7d;"># IMAP Sieve RFC6785</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">anyof</span> (<span style="color:#7f8c8d;">environment</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;imap.cause&quot;</span> <span style="color:#f44f4f;">&quot;APPEND&quot;</span>, <span style="color:#7f8c8d;">environment</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;imap.cause&quot;</span> <span style="color:#f44f4f;">&quot;COPY&quot;</span>)  {
    <span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">environment</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;imap.mailbox&quot;</span> <span style="color:#f44f4f;">&quot;ActionItems&quot;</span> {
        <span style="color:#8e44ad;">redirect</span> <span style="color:#27ae60;">:copy</span> <span style="color:#f44f4f;">&quot;actionitems@example.com&quot;</span>;
    }
}

<span style="color:#7a7c7d;"># IMAP4 Flags RFC5232</span>
<span style="color:#8e44ad;">setflag</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">Deleted&quot;</span>;
<span style="color:#8e44ad;">setflag</span> <span style="color:#f44f4f;">&quot;flagvar&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">Flagged&quot;</span>;
<span style="color:#8e44ad;">addflag</span> <span style="color:#f44f4f;">&quot;flagvar&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">Deleted&quot;</span>;
<span style="color:#8e44ad;">addflag</span> <span style="color:#f44f4f;">&quot;flagvar&quot;</span> [<span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">Deleted&quot;</span>, <span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">Answered&quot;</span>];
<span style="color:#8e44ad;">removeflag</span> <span style="color:#f44f4f;">&quot;flagvar&quot;</span> <span style="color:#f44f4f;">&quot;$MDNRequired&quot;</span>;
<span style="color:#7f8c8d;">hasflag</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;MyVar&quot;</span> <span style="color:#f44f4f;">&quot;Junk&quot;</span>
<span style="color:#7f8c8d;">hasflag</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${MyVar}</span><span style="color:#f44f4f;">&quot;</span> [<span style="color:#f44f4f;">&quot;label&quot;</span>, <span style="color:#f44f4f;">&quot;forward&quot;</span>]
<span style="color:#7f8c8d;">hasflag</span> <span style="color:#0099ff;font-weight:bold;">:count</span> <span style="color:#f44f4f;">&quot;ge&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#f44f4f;">&quot;MyFlags&quot;</span> <span style="color:#f67400;">2</span>
<span style="color:#8e44ad;">fileinto</span> <span style="color:#27ae60;">:flags</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">Deleted&quot;</span> <span style="color:#f44f4f;">&quot;INBOX.bla&quot;</span>;

<span style="color:#7a7c7d;"># Include RFC6609</span>
<span style="color:#8e44ad;">include</span> <span style="color:#27ae60;">:personal</span> <span style="color:#f44f4f;">&quot;always_allow&quot;</span>;
<span style="color:#8e44ad;">include</span> <span style="color:#27ae60;">:global</span> <span style="color:#f44f4f;">&quot;spam_tests&quot;</span>;
<span style="color:#8e44ad;">return</span>;
<span style="font-weight:bold;">global</span> <span style="color:#f44f4f;">&quot;i_am_on_vacation&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#f44f4f;">&quot;global.i_am_on_vacation&quot;</span> <span style="color:#f44f4f;">&quot;1&quot;</span>;

<span style="color:#7a7c7d;"># Mailbox RFC5490</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">mailboxexists</span> <span style="color:#f44f4f;">&quot;bla&quot;</span> {}
<span style="color:#8e44ad;">fileinto</span> <span style="color:#27ae60;">:create</span> <span style="color:#f44f4f;">&quot;inbox.bla&quot;</span>;
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">metadata</span> <span style="color:#0099ff;font-weight:bold;">:is</span> <span style="color:#f44f4f;">&quot;INBOX&quot;</span> <span style="color:#f44f4f;">&quot;/private/vendor/vendor.isode/auto-replies&quot;</span> <span style="color:#f44f4f;">&quot;on&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">metadataexists</span> <span style="color:#f44f4f;">&quot;INBOX&quot;</span> <span style="color:#f44f4f;">&quot;/private/vendor/foo&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">servermetadata</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot;/private/vendor/vendor.isode/notification-uri&quot;</span> <span style="color:#f44f4f;">&quot;*&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">servermetadataexists</span> <span style="color:#f44f4f;">&quot;/private/vendor/foo&quot;</span> {}

<span style="color:#7a7c7d;"># Regexp (draft)</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">not</span> <span style="color:#7f8c8d;">address</span> <span style="color:#0099ff;font-weight:bold;">:regex</span> [<span style="color:#f44f4f;">&quot;to&quot;</span>, <span style="color:#f44f4f;">&quot;cc&quot;</span>, <span style="color:#f44f4f;">&quot;bcc&quot;</span>] <span style="color:#f44f4f;">&quot;me(</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">+.*)?@company</span><span style="color:#3daee9;">\\</span><span style="color:#f44f4f;">.com&quot;</span> {}

<span style="color:#7a7c7d;"># Relational RFC5231</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">address</span> <span style="color:#0099ff;font-weight:bold;">:count</span> <span style="color:#f44f4f;">&quot;ge&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> [<span style="color:#f44f4f;">&quot;to&quot;</span>, <span style="color:#f44f4f;">&quot;cc&quot;</span>] [<span style="color:#f44f4f;">&quot;3&quot;</span>] {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;lt&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> [<span style="color:#f44f4f;">&quot;x-priority&quot;</span>] [<span style="color:#f44f4f;">&quot;3&quot;</span>] {}

<span style="color:#7a7c7d;"># Spamtest RFC5235</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">spamtest</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;eq&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#f44f4f;">&quot;0&quot;</span> {}
<span style="font-weight:bold;">elsif</span> <span style="color:#7f8c8d;">spamtest</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;ge&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#f44f4f;">&quot;3&quot;</span> {}
<span style="font-weight:bold;">elsif</span> <span style="color:#7f8c8d;">spamtest</span> <span style="color:#27ae60;">:percent</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;lt&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#f44f4f;">&quot;37&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">virustest</span> <span style="color:#0099ff;font-weight:bold;">:value</span> <span style="color:#f44f4f;">&quot;eq&quot;</span> <span style="color:#27ae60;">:comparator</span> <span style="color:#f44f4f;">&quot;i;ascii-numeric&quot;</span> <span style="color:#f44f4f;">&quot;4&quot;</span> {}

<span style="color:#7a7c7d;"># Subaddress RFC5233</span>
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">envelope</span> <span style="color:#27ae60;">:user</span> <span style="color:#f44f4f;">&quot;to&quot;</span> <span style="color:#f44f4f;">&quot;postmaster&quot;</span> {}
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">envelope</span> <span style="color:#27ae60;">:detail</span> <span style="color:#f44f4f;">&quot;to&quot;</span> <span style="color:#f44f4f;">&quot;mta-filters&quot;</span> {}

<span style="color:#7a7c7d;"># Vacation RFC5230</span>
<span style="color:#8e44ad;">vacation</span> <span style="color:#f44f4f;">&quot;I'm out&quot;</span>;
<span style="color:#8e44ad;">vacation</span> <span style="color:#27ae60;">:subject</span> <span style="color:#f44f4f;">&quot;Automatic response to: </span><span style="color:#27aeae;">${1}</span><span style="color:#f44f4f;">&quot;</span>
                  <span style="color:#f44f4f;">&quot;I'm away -- send mail to foo in my absence&quot;</span>;
<span style="color:#8e44ad;">vacation</span> <span style="color:#27ae60;">:handle</span> <span style="color:#f44f4f;">&quot;ran-away&quot;</span> <span style="color:#f44f4f;">&quot;I'm out&quot;</span>;
<span style="color:#8e44ad;">vacation</span> <span style="color:#27ae60;">:mime</span> <span style="color:#f44f4f;">text:</span>
<span style="color:#f44f4f;">   Content-Type: multipart/alternative; boundary=foo</span>

<span style="color:#f44f4f;">   --foo</span>

<span style="color:#f44f4f;">   Hello </span><span style="color:#27aeae;">${sender}</span><span style="color:#f44f4f;">, I'm at the beach relaxing.</span>

<span style="color:#f44f4f;">   --foo</span>
<span style="color:#f44f4f;">   Content-Type: text/html; charset=us-ascii</span>

<span style="color:#f44f4f;">   &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot;</span>
<span style="color:#f44f4f;">    &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;</span>
<span style="color:#f44f4f;">   &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;How to relax&lt;/TITLE&gt;</span>
<span style="color:#f44f4f;">   &lt;BASE HREF=&quot;http://home.example.com/pictures/&quot;&gt;&lt;/HEAD&gt;</span>
<span style="color:#f44f4f;">   &lt;BODY&gt;&lt;P&gt;I'm at the &lt;A HREF=&quot;beach.gif&quot;&gt;beach&lt;/A&gt; relaxing.</span>
<span style="color:#f44f4f;">   &lt;/BODY&gt;&lt;/HTML&gt;</span>

<span style="color:#f44f4f;">   --foo--</span>
<span style="color:#f44f4f;">.</span>
;
<span style="color:#8e44ad;">vacation</span> <span style="color:#27ae60;">:days</span> <span style="color:#f67400;">23</span> <span style="color:#27ae60;">:addresses</span> [<span style="color:#f44f4f;">&quot;kde@example.edu&quot;</span>] <span style="color:#f44f4f;">&quot;I'm away until October 19.&quot;</span>;

<span style="color:#7a7c7d;"># Vacation Seconds RFC6131</span>
<span style="color:#8e44ad;">vacation</span> <span style="color:#27ae60;">:addresses</span> [<span style="color:#f44f4f;">&quot;kde@example.edu&quot;</span>] <span style="color:#27ae60;">:seconds</span> <span style="color:#f67400;">1800</span>
    <span style="color:#f44f4f;">&quot;I am in a meeting, and do not have access to email.&quot;</span>;

<span style="color:#7a7c7d;"># Variables RFC5229</span>
<span style="color:#f44f4f;">&quot;&amp;%${}!&quot;</span> <span style="color:#7a7c7d;"># invalid</span>
<span style="color:#f44f4f;">&quot;${doh!}&quot;</span> <span style="color:#7a7c7d;">#invalid</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${company}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;bla </span><span style="color:#27aeae;">${var42}</span><span style="color:#f44f4f;"> blub&quot;</span>
<span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${1}</span><span style="color:#f44f4f;">&quot;</span>
<span style="color:#f44f4f;">&quot;${BAD</span><span style="color:#27aeae;">${Company}</span><span style="color:#f44f4f;">&quot;</span> <span style="color:#7a7c7d;"># second one is the variable</span>
<span style="color:#f44f4f;">&quot;${President, </span><span style="color:#27aeae;">${Company}</span><span style="color:#f44f4f;"> Inc.}&quot;</span> <span style="color:#7a7c7d;"># inner one is the variable</span>
<span style="color:#8e44ad;">set</span> <span style="color:#f44f4f;">&quot;var&quot;</span> <span style="color:#f44f4f;">&quot;value&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#f44f4f;">&quot;var2&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${var}</span><span style="color:#f44f4f;">&quot;</span>;

<span style="color:#8e44ad;">set</span> <span style="color:#f44f4f;">&quot;a&quot;</span> <span style="color:#f44f4f;">&quot;juMBlEd lETteRS&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:length</span> <span style="color:#f44f4f;">&quot;b&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${a}</span><span style="color:#f44f4f;">&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:lower</span> <span style="color:#f44f4f;">&quot;b&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${a}</span><span style="color:#f44f4f;">&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:upperfirst</span> <span style="color:#f44f4f;">&quot;b&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${a}</span><span style="color:#f44f4f;">&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:upperfirst</span> <span style="color:#27ae60;">:lower</span> <span style="color:#f44f4f;">&quot;b&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${a}</span><span style="color:#f44f4f;">&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:quotewildcard</span> <span style="color:#f44f4f;">&quot;b&quot;</span> <span style="color:#f44f4f;">&quot;Rock*&quot;</span>;
<span style="color:#8e44ad;">set</span> <span style="color:#27ae60;">:lowerfirst</span> <span style="color:#f44f4f;">&quot;b&quot;</span> <span style="color:#f44f4f;">&quot;</span><span style="color:#27aeae;">${a}</span><span style="color:#f44f4f;">&quot;</span>;

<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">string</span> <span style="color:#0099ff;font-weight:bold;">:matches</span> <span style="color:#f44f4f;">&quot; </span><span style="color:#27aeae;">${state}</span><span style="color:#f44f4f;"> &quot;</span> <span style="color:#f44f4f;">&quot;* pending *&quot;</span> {}

<span style="color:#7a7c7d;"># Dovecot debug extension</span>
<span style="font-weight:bold;">require</span> <span style="color:#f44f4f;">&quot;vnd.dovecot.debug&quot;</span>;
<span style="font-weight:bold;">if</span> <span style="color:#7f8c8d;">header</span> <span style="color:#0099ff;font-weight:bold;">:contains</span> <span style="color:#f44f4f;">&quot;subject&quot;</span> <span style="color:#f44f4f;">&quot;hello&quot;</span> {
    <span style="color:#8e44ad;">debug_log</span> <span style="color:#f44f4f;">&quot;Subject header contains hello!&quot;</span>;
}
</pre></body></html>
